package testdao;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.orz.entity.Usertable;
import com.orz.interfaces.SimpleDaoInterface;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "../applicationContext.xml")
public class SimpleDaoTest {
	@Autowired
	private SimpleDaoInterface<Object> simpledao;

	@Test
	@Rollback(true)
	public void testaddObject() {
		System.out.println("执行测试");
		Usertable us = new Usertable("toms", "9527", "orz");
		Object obj = simpledao.addObject(us);
		Assert.assertSame(us, obj);
		System.out.println("运行完成");
	}
}
